package com.baidu.mapper;

import com.baidu.pojo.TbSpecification;
import com.baidu.pojo.TbSpecificationOption;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface TbSpecificationOptionMapper extends BaseMapper<TbSpecificationOption> {

    @Select("select * from tb_specification where id=#{id}")
    TbSpecification findTbSpecificationById(@Param("id") Long id);

    @Delete("delete from tb_specification_option where spec_id=#{id}")
    void deleteBySpecId(@Param("id")Long id);

    @Select("select * from tb_specification_option where spec_id=#{id}")
    List<TbSpecificationOption> findTbSpecificationOption(@Param("id")Integer id);
    
}
